home *** CD-ROM | disk | FTP | other *** search
PiXCL source | 1996-07-31 | 2.0 KB | 104 lines |
- Initialize:
- WinGetActive(Win$)
- UseCoordinates(PIXEL)
- UseBackGround(OPAQUE,192,192,192)
- DrawBackGround
- WaitInput(100) {let NT and 95 catch up}
- InfoMenu(REMOVE)
- SetMenu()
- WinLocate(Win$,100,100,450,300,Res)
- Title$ = "Embedded If-Else-Endif"
- WinTitle(Win$, Title$)
-
-
-
- SetMenu("Exit!",Leave,
- ENDPOPUP,
- "Embed If Testing",EmbeddedIfThen,
- ENDPOPUP,
- "Multitest Loop",MultiTest,
- ENDPOPUP)
-
-
- Number1 = 0
- Number2 = 0
- Levels = 0
-
-
- Wait_for_Input:
- WaitInput()
-
-
- Leave:
- End
-
-
- EmbeddedIfThen:
- GoSub IfThenTest
- Goto Wait_for_Input
-
-
- MultiTest:
- DrawBackGround
- WinGetClientRect("",cx1,cy1,cx2,cy2)
- DrawIcon(1,1,0,0,INFORMATION)
- DrawTextExt(40,cy1,cx2,cy2,
- "This function tests 'If-Then' commands embedded in an 'If-Else-Endif' construction. The process iterates 50 times. Change it if you want !",LEFT)
- WaitInput(2500)
- DrawBackground
- Test = 0
- TestLoop:
- GoSub IfThenTest
- Test++
- WaitInput(1)
- If Test < 50 Then Goto TestLoop
-
- Goto Wait_for_Input
-
-
- IfThenTest: {=== subroutine ===}
- DrawBackground
- Levels++
- DrawNumber(150,30,Levels)
- If Number1 = 0
- { here's a comment with an endif }
- DrawIcon(1,1,0,0,ICON01)
- If Number2 = 0 Then DrawIcon(80,1,0,0,ICON03)
- WaitInput(1)
- Number2++
- If Number2 = 2 Then Number1 = 1
- If Number2 = 4 Then Number2 = 0
-
- {here's an embedded If-Endif}
-
- If Number1 = 0
- DrawIcon(1,1,0,0,ICON07)
- If Number = 1
- DrawIcon(10,10,0,0,ICON10)
- If Number = 1
- DrawIcon(20,20,0,0,ICON10)
- If Number =1 Then DrawIcon(10,10,60,60,ICON13)
- Endif
- Endif
- Else
- DrawIcon(1,1,0,0,ICON08)
- Endif
-
- Else
- DrawIcon(1,1,0,0,ICON04)
- If Number2 = 1 Then DrawIcon(80,1,0,0,ICON06)
- If Number2 = 2 Then Number1 = 0
- Number2++
-
- If Number1 = 1
- DrawIcon(1,10,0,0,ICON09)
- Number = 0
- Else
- DrawIcon(1,10,0,0,ICON10)
- Number = 1
- Endif
-
-
- Endif
- Return
-